let userinfoModel = require("../../model/auth/userTable");
let userinfoService = {
  add: (info) => {
    return userinfoModel.insertMany([info]);
  },
  query: (info) => {
    return userinfoModel
      .find(info)
      .sort({ _id: -1 })
      .skip(info.page - 1 * info.size)
      .limit(info.size);
  },
  delete: (info) => {
    return userinfoModel.remove(info);
  },
  update: (info) => {
    return userinfoModel.updateOne({ _id: info._id }, info);
  },
};
module.exports = userinfoService;
